//
//  StringExtension.swift
//  HuaDaoPeifu
//
//  Created by Erickson on 16/5/26.
//  Copyright © 2016年 paiyipai. All rights reserved.
//

import Foundation


extension String {
    
    func rangeColorString(_ subString:String,color:UIColor)->NSAttributedString {
        let range = (self as NSString).range(of: subString)
        let attributedString = NSMutableAttributedString(string:self)
        attributedString.addAttribute(NSForegroundColorAttributeName, value: color , range: range)
        return attributedString
    }
}
